const TOKEN_KEY = 'token'
// 是否登录
const isLogin = () => {
  return !!localStorage.getItem(TOKEN_KEY)
}
// 获取token
const getToken = () => {
  return 'Bearer ' + localStorage.getItem(TOKEN_KEY)
}
// 设置token
const setToken = (token: string) => {
  localStorage.setItem(TOKEN_KEY, token)
}
// 清除token
const clearToken = () => {
  localStorage.removeItem(TOKEN_KEY)
}

export { isLogin, getToken, setToken, clearToken }
